<template>

</template>

<script lang="ts" setup>
import { onBeforeMount, onBeforeUnmount, onBeforeUpdate, onMounted, onUpdated, onUnmounted } from 'vue';

    //vue3生命周期只有6个 before和created被setup替代

    onBeforeMount(() => {
        console.log("dom加载完成之前");
        
    })
    onMounted(() => {
        console.log("dom加载完成之后")
    })
    onBeforeUpdate(() => {
        console.log("数据更新之前")
    })
    onUpdated(() => {
        console.log("数据更新之后");
        
    })
    onBeforeUnmount(() => {
        console.log("实例销毁之前")
    })
    onUnmounted(() => {
        console.log("实例销毁之后")
    })
</script>